Send IDONTWANT prior to publish#386
Merged
StefanBratanov merged 2 commits intolibp2p:developfrom Oct 18, 2024
Merged
Conversation
Nashatyrev
approved these changes
Oct 18, 2024
Collaborator
Nashatyrev
left a comment
There was a problem hiding this comment.
LGTM, I'd just leave the peer exclusion
| } | ||
|
|
||
| private fun iDontWant(msg: PubsubMessage, receivedFrom: PeerHandler) { | ||
| private fun iDontWant(msg: PubsubMessage) { |
Collaborator
There was a problem hiding this comment.
TBH I would leave the excluded peer. We are saving one IDONTWANT message for free.
Suggested change
| private fun iDontWant(msg: PubsubMessage) { | |
| private fun iDontWant(msg: PubsubMessage?) { |
| .mapNotNull { mesh[it] } | ||
| .flatten() | ||
| .distinct() | ||
| .minus(receivedFrom) |
Collaborator
There was a problem hiding this comment.
.minus(setOfNotNull(receivedFrom))
Collaborator
Author
There was a problem hiding this comment.
Oh, I was looking for a nice way to add it back. This one seems good. Implemented.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Send IDONTWANT on each publish. Maybe we need to add some filtering to make it more selective, but not sure?
I removed filtering out excluding the
receivedFrompeer when we are sending IDONTWANT on inbound messages. Think it simplifies the flow and could help in some cases, wherereceivedFrommay send the same message twice.fixes #383